<template>
  <van-header title="电台"></van-header>
  <div class="loading" v-if="diantaisbanner.data.length == 0">
    <van-loading size="24px" vertical>加载中...</van-loading>
  </div>
  <div class="page" v-else>
    <!-- 电台轮播 -->
    <van-swipe class="swiper">
      <van-swipe-item v-for="(item, index) in diantaisbanner.data" :key="index">
        <img :src="item.pic" />
      </van-swipe-item>
    </van-swipe>
    <!-- 宫格导航 -->
    <van-my-grid :list="diantaisnav.categories" icon-color="#fff"></van-my-grid>
    <!-- 推荐楼层 -->
    <div class="floor">
      <div class="floor-header">
        <p>热门电台</p>
        <span></span>
      </div>
      <van-floor-defaut :list="diantaisremen.djRadios"></van-floor-defaut>
    </div>
    <div class="floor">
      <div class="floor-header">
        <p>付费精选</p>
        <span></span>
      </div>
      <van-floor-defaut :list="diantaisfufei.data.list" :fufei="true"></van-floor-defaut>
    </div>
  </div>
</template>

<script setup lang="ts">
import VanHeader from '@/components/header/Header.vue';
import VanMyGrid from '@/components/grid/Grid.vue';
import VanFloorDefaut from '@/components/floor/FloorDefaut.vue';

import diantaisbanner from '@/api/mock/diantai-lunbo.json';
import diantaisremen from '@/api/mock/diantai-remen.json';
import diantaisfufei from '@/api/mock/diantai-fufei.json';
import diantaisnav from '@/api/mock/diantai-nav.json';
</script>

<style lang="less" scoped>
.swiper {
  height: 160px;
  border-radius: 10px;
  img {
    width: 100%;
    height: 100%;
  }
}
// 楼层
.floor {
  padding: 10px 0;
  img {
    width: 100%;
    height: 110px;
    border-radius: 10px;
  }
  .floor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    p {
      font-size: 14px;
      font-weight: 600;
    }
    span {
      color: #969799;
    }
  }
}
</style>
